package com.dms.vuemusic.mapper;

import com.dms.vuemusic.pojo.Music;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MusicMapper {
    @Insert("insert into usersavesong(userName,musicName) values (#{userName},#{musicName})")
    void insertMusic(Music music);
    @Delete("delete from usersavesong where musicName=#{musicName}")
    void deleteMusic(Music music);
    @Select("select * from usersavesong where userName=#{userName} and musicName=#{musicName}")
    Music searchRecord(Music music);
    @Select("select musicName from usersavesong where userName=#{userName}")
    List<Music> searchRecordList(String userName);
}
